import 'dart:convert' show json;

class CategoryGoodsListBeanResult {

  int? code;
  String? msg;
  List<CategoryGoodsListBean?>? data;

  CategoryGoodsListBeanResult.fromParams({this.code, this.msg, this.data});

  factory CategoryGoodsListBeanResult(Object jsonStr) => jsonStr is String ? CategoryGoodsListBeanResult.fromJson(json.decode(jsonStr)) : CategoryGoodsListBeanResult.fromJson(jsonStr);

  static CategoryGoodsListBeanResult? parse(jsonStr) => ['null', '', null].contains(jsonStr) ? null : CategoryGoodsListBeanResult(jsonStr);

  CategoryGoodsListBeanResult.fromJson(jsonRes) {
    code = jsonRes['code'];
    msg = jsonRes['msg'];
    data = jsonRes['data'] == null ? null : [];

    for (var dataItem in data == null ? [] : jsonRes['data']){
      data!.add(dataItem == null ? null : CategoryGoodsListBean.fromJson(dataItem));
    }
  }

  @override
  String toString() {
    return '{"code": $code, "msg": ${msg != null?'${json.encode(msg)}':'null'}, "data": $data}';
  }

  String toJson() => this.toString();
}

class CategoryGoodsListBean {

  int? category_id;
  int? goods_sales_count;
  int? goods_stock_count;
  int? id;
  double? goods_default_price;
  String? goods_attribute;
  String? goods_banner;
  String? goods_code;
  String? goods_default_icon;
  String? goods_desc;
  String? goods_detail_one;
  String? goods_detail_two;
  List<String?>? bannerList;
  List<CategoryGoodsListBeanGoodsInfoList?>? goodsInfoList;

  CategoryGoodsListBean.fromParams({this.category_id, this.goods_sales_count, this.goods_stock_count, this.id, this.goods_default_price, this.goods_attribute, this.goods_banner, this.goods_code, this.goods_default_icon, this.goods_desc, this.goods_detail_one, this.goods_detail_two, this.bannerList, this.goodsInfoList});

  CategoryGoodsListBean.fromJson(jsonRes) {
    category_id = jsonRes['category_id'];
    goods_sales_count = jsonRes['goods_sales_count'];
    goods_stock_count = jsonRes['goods_stock_count'];
    id = jsonRes['id'];
    goods_default_price = jsonRes['goods_default_price'];
    goods_attribute = jsonRes['goods_attribute'];
    goods_banner = jsonRes['goods_banner'];
    goods_code = jsonRes['goods_code'];
    goods_default_icon = jsonRes['goods_default_icon'];
    goods_desc = jsonRes['goods_desc'];
    goods_detail_one = jsonRes['goods_detail_one'];
    goods_detail_two = jsonRes['goods_detail_two'];
    bannerList = jsonRes['bannerList'] == null ? null : [];

    for (var bannerListItem in bannerList == null ? [] : jsonRes['bannerList']){
      bannerList!.add(bannerListItem);
    }

    goodsInfoList = jsonRes['goodsInfoList'] == null ? null : [];

    for (var goodsInfoListItem in goodsInfoList == null ? [] : jsonRes['goodsInfoList']){
      goodsInfoList!.add(goodsInfoListItem == null ? null : CategoryGoodsListBeanGoodsInfoList.fromJson(goodsInfoListItem));
    }
  }

  @override
  String toString() {
    return '{"category_id": $category_id, "goods_sales_count": $goods_sales_count, "goods_stock_count": $goods_stock_count, "id": $id, "goods_default_price": $goods_default_price, "goods_attribute": ${goods_attribute != null?'${json.encode(goods_attribute)}':'null'}, "goods_banner": ${goods_banner != null?'${json.encode(goods_banner)}':'null'}, "goods_code": ${goods_code != null?'${json.encode(goods_code)}':'null'}, "goods_default_icon": ${goods_default_icon != null?'${json.encode(goods_default_icon)}':'null'}, "goods_desc": ${goods_desc != null?'${json.encode(goods_desc)}':'null'}, "goods_detail_one": ${goods_detail_one != null?'${json.encode(goods_detail_one)}':'null'}, "goods_detail_two": ${goods_detail_two != null?'${json.encode(goods_detail_two)}':'null'}, "bannerList": ${bannerList != null?'${json.encode(bannerList)}':'null'}, "goodsInfoList": $goodsInfoList}';
  }

  String toJson() => this.toString();
}

class CategoryGoodsListBeanGoodsInfoList {

  Object? bannerList;
  Object? goodsInfoList;
  int? category_id;
  int? goods_sales_count;
  int? goods_stock_count;
  int? id;
  double? goods_default_price;
  String? goods_attribute;
  String? goods_banner;
  String? goods_code;
  String? goods_default_icon;
  String? goods_desc;
  String? goods_detail_one;
  String? goods_detail_two;

  CategoryGoodsListBeanGoodsInfoList.fromParams({this.bannerList, this.goodsInfoList, this.category_id, this.goods_sales_count, this.goods_stock_count, this.id, this.goods_default_price, this.goods_attribute, this.goods_banner, this.goods_code, this.goods_default_icon, this.goods_desc, this.goods_detail_one, this.goods_detail_two});

  CategoryGoodsListBeanGoodsInfoList.fromJson(jsonRes) {
    bannerList = jsonRes['bannerList'];
    goodsInfoList = jsonRes['goodsInfoList'];
    category_id = jsonRes['category_id'];
    goods_sales_count = jsonRes['goods_sales_count'];
    goods_stock_count = jsonRes['goods_stock_count'];
    id = jsonRes['id'];
    goods_default_price = jsonRes['goods_default_price'];
    goods_attribute = jsonRes['goods_attribute'];
    goods_banner = jsonRes['goods_banner'];
    goods_code = jsonRes['goods_code'];
    goods_default_icon = jsonRes['goods_default_icon'];
    goods_desc = jsonRes['goods_desc'];
    goods_detail_one = jsonRes['goods_detail_one'];
    goods_detail_two = jsonRes['goods_detail_two'];
  }

  @override
  String toString() {
    return '{"bannerList": $bannerList, "goodsInfoList": $goodsInfoList, "category_id": $category_id, "goods_sales_count": $goods_sales_count, "goods_stock_count": $goods_stock_count, "id": $id, "goods_default_price": $goods_default_price, "goods_attribute": ${goods_attribute != null?'${json.encode(goods_attribute)}':'null'}, "goods_banner": ${goods_banner != null?'${json.encode(goods_banner)}':'null'}, "goods_code": ${goods_code != null?'${json.encode(goods_code)}':'null'}, "goods_default_icon": ${goods_default_icon != null?'${json.encode(goods_default_icon)}':'null'}, "goods_desc": ${goods_desc != null?'${json.encode(goods_desc)}':'null'}, "goods_detail_one": ${goods_detail_one != null?'${json.encode(goods_detail_one)}':'null'}, "goods_detail_two": ${goods_detail_two != null?'${json.encode(goods_detail_two)}':'null'}}';
  }

  String toJson() => this.toString();
}